package im.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class MessageServlet extends HttpServlet {
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String msg = request.getParameter("message").toString();
		String msgType = request.getParameter("messageType").toString();
		String touserid = request.getParameter("touserid").toString();
		
		//Map userMap = (Map)request.getSession().getAttribute("user");
		//String userid = userMap.get("userId").toString();
		
		if("p2p".equals(msgType)){//点对点
			
		}else if("p2m".equals(msgType)){//多人聊天
			
		}
		
		PrintWriter out = response.getWriter();
		out.println("ok");
		out.flush();
		out.close();
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		this.doGet(request, response);
	}

	public void init() throws ServletException {
		// Put your code here
	}

}
